package com.chengqs.rainbow.im.gateway.util;

import com.chengqs.rainbow.common.core.domain.JsonResult;
import com.chengqs.rainbow.common.protobuf.Result;

/**
 * <B>主类名称：</B>ResultConverter<BR>
 * <B>概要说明：</B>enter<BR>
 *
 * @author: chengqs
 * @create: 2025-09-13 16:23:33
 **/
public class ResultConverter {
    public static <T> JsonResult<T> convert(Result result) {
        JsonResult<T> jsonResult = new JsonResult<>();
        jsonResult.setSuccess(result.getSuccess());
        jsonResult.setErrorCode(result.getErrorCode());
        jsonResult.setErrorMessage(result.getErrorMessage());
        return jsonResult;
    }
}
